package org.misty.seckill.service.impl;

import org.misty.seckill.dao.GoodsDao;
import org.misty.seckill.service.GoodsService;
import org.misty.seckill.vo.SGoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {
  @Autowired
  private GoodsDao goodsDao;

  @Override
  public List<SGoodsVo> listSecKills() {
    return goodsDao.listSecKills();
  }

  @Override
  public SGoodsVo getDetailBySid(long id) {
    return goodsDao.getDetailBySid(id);
  }

  @Override
  public SGoodsVo getDetailByOid(long orderId) {
    return goodsDao.getDetailByOid(orderId);
  }

  @Override
  public int decrStock(long sid, int count) {
    return goodsDao.decrStock(sid, count);
  }

  @Override
  public int resetStock(int total) {
    return goodsDao.resetStock(total);
  }
}
